﻿@{
    ViewBag.Title = "CodeView";
}
<h2>Introduction to GenericServices</h2>
<p>
    GenericServices is a .NET class library which helps a developer build a
    <a href="http://martinfowler.com/eaaCatalog/serviceLayer.html" target="_blank">service layer</a>,
    i.e. a layer that acts as a facard/adapter between your business/data service layers and your User Interface or HTTP service.

    It does this by providing standard database CRUD (Create, Read, Update and Delete) methods and a standard way of
    calling business methods, each with clear extension points.
    The aim is to cut out the standard boiler-plate code so the user only has to write the data or business specific code.
</p>
<p>
    Some ASP.NET MVC specific features which build on the GenericService are also included.
    For instance the best way to call GenericService commands in a Controller and handling long-running tasks.
</p>
<hr />
<h3>Summary of the features covered by this example web site</h3>

<h4>1. Simple, but robust database services</h4>
<p>
    Database accesses are normally a big part of enterprise systems build with APS.NET MVC. However, my experience is that creating these services
    in a robust and comprehensive form can lead to a lot of repetative code that does the same thing, but for different data.
    The aim of the GenericFramework framework is to handles all of the standard cases, and include extension points for when special handling is required.
    Examples of there use on this web site are:
</p>
<ul>
    <li>See normal, synchronous access using a <abbr title="Data Transfer Object">DTO</abbr> for shaping in the @Html.ActionLink("Posts", "Index", "Posts") Controller</li>
    <li>See new EF6 async access using a <abbr title="Data Transfer Object">DTO</abbr> for shaping in the @Html.ActionLink("PostsAsync", "Index", "PostsAsync") Controller</li>
    <li>See normal, synchronous access directly via data class in the @Html.ActionLink("Tags", "Index", "Tags") Controller</li>
    <li>See new EF6 async access directly via data class in the @Html.ActionLink("TagsAsync", "Index", "TagsAsync") Controller</li>
</ul>

<p>
    Note that the SampleMvcWebApp uses <a href="https://github.com/autofac/Autofac/wiki/Getting-Started" target="_blank">AutoFac</a>
    dependency injection framework to insert calls to the various GenericServices services.
</p>





